﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Topics_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript" language="javascript">
    </script>
    <script>
        $(document).ready(function () {
            var id = $("#hidTopicsId").val();
            var checks = $("input[tt=aa]");
            for (var i = 0; i < checks.length; i++) {
                if ($(checks[i]).val() == id) {
                    checks[i].checked = true;
                }
            }
            $("input[tt=aa]").click(function () {
                var data = $("input[tt=aa]");
                for (var i = 0; i < data.length; i++) {
                    data[i].checked = false;
                }
                this.checked = true;
            })

        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
     <div class="button_bar">
	    <input type="button" class="common_button" id="btnBack" value="返回"/>
        <asp:Button ID="btnSave" CssClass="common_button" runat="server" Text="设置显示专题" 
             Width="100px" onclick="btnSave_Click" />
         <asp:Button ID="btnAddType" runat="server" Text="添加专题类型" 
             CssClass="common_button" Width="120" onclick="btnAddType_Click" />
         <asp:Button ID="btnAdd" runat="server" Text="添加专题" CssClass="common_button" 
             Width="80" onclick="btnAdd_Click" />
    </div>
    <table class="query_form_table">
        <tr>
            <th>
                专题类型
            </th>
            <td>
                <asp:DropDownList ID="ddlType" runat="server" 
                    onselectedindexchanged="ddlType_SelectedIndexChanged"  AutoPostBack="True" />
            </td>
            <td>
            
            </td>
            <td></td>
         </tr>
    </table>
    <div>
          <table class="data_list_table">
            <tr>
                <th>
                    当前项
                </th>
                <th>
                    专题编号
                </th>
                <th>
                    专题名称
                </th>
                <th>
                   时间
                </th>
                <th>
                  专题类型
                </th>
                <th>
                    操作
                </th>
            </tr>
              <asp:Repeater ID="Repeater1" runat="server" 
                  onitemdatabound="Repeater1_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td>
                              <input name="select" value='<%# Eval("id") %>' type="checkbox" tt="aa" id="select"
                             />
                        </td>
                        <td>
                            <%# Eval("TypeId")%>
                        </td>
                        <td>
                            <%# Eval("Name")%>
                        </td>
                        <td>
                            <%# Eval("CTime")%>
                        </td>
                        <td>
                            <%# Eval("typename")%>
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server"><img src="../images/bt_detail.gif" alt="查看" /></asp:HyperLink>
                            <asp:HiddenField ID="hidTypeId"  runat="server" Value=' <%# Eval("TypeId")%>' />
                            <asp:HiddenField ID="hidId"  runat="server" Value=' <%# Eval("id")%>' />
                            <a href='delete.aspx?id=<%# Eval("id") %>' onclick="return confirm('确定是否删除')"><img src="../images/bt_del.gif" alt="删除" /></a>
                        </td>
                    </tr>
                </ItemTemplate>
              </asp:Repeater>
            </table>
    </div>
    <asp:HiddenField ID="hidTopicsId" runat="server" />
    </form>
</body>
</html>
